//
// Created by tcj on 2021/12/8.
//

#ifndef SERVER_FRAMEWORK_SINGLETON_H
#define SERVER_FRAMEWORK_SINGLETON_H
#include <memory>

namespace sylar{
    template<class T,class X=void,int N=0>
    class Singleton{
    public:
//       返回单例裸指针
        static T* GetInstance(){
            static T v;
            return &v;
        }
    };

    template<class T,class X=void,int N=0>
    class SinglePtr{
    public:
        static std::shared_ptr<T> GetInsance(){
            static std::shared_ptr<T> v(new T);
            return v;
        }
    };


}

#endif //SERVER_FRAMEWORK_SINGLETON_H
